﻿package  {
	
	public class Zerrenda {

		public var zerrenda:Array;

		public function Zerrenda() {
			zerrenda = new Array();
		}
		
		public function hasieratu(z:Array){

			zerrenda = z;
		}
		
		public function nahastu()
		{
			var temp1:String;
			var temp2:int;
			var rnd1:int;
			var rnd2:int;
			var i:int;
			
			for (i=0; i<zerrenda.length; i++)
			{
				rnd1 = Math.random() * zerrenda.length;
				rnd2 = Math.random() * zerrenda.length;
				temp1 = zerrenda[rnd1];
				zerrenda[rnd1] = zerrenda[rnd2];
				zerrenda[rnd2] = temp1;
			}
		}//nahastu
		
		public function luzera() : int {
			return zerrenda.length;
		}
		
		public function getElementua(i :int) : String{
			return zerrenda[i];
		}
		
		public function setElementua(i :int, s:String){
			zerrenda[i]= s;
		}

	}
	
}
